package com.wkbb.basic.thread;

import com.wkbb.basic.feign.DoorFeignService;
import lombok.extern.slf4j.Slf4j;

/**
 * @author yangdaofang
 * 创建时间：2019-11-26 10:20
 */
@Slf4j
public class SynClassTask implements Runnable {
    private DoorFeignService doorFeignService;
    private Long orgId;
    private Long classId;

    public SynClassTask(DoorFeignService doorFeignService, Long orgId, Long classId) {
        this.doorFeignService = doorFeignService;
        this.orgId = orgId;
        this.classId = classId;
    }

    public SynClassTask() {}

    @Override
    public void run() {
        try {
            log.info("进入同步班级信息到门禁.....start，orgId:{}，classId:{}", orgId, classId);
            Thread.sleep(1000);
            doorFeignService.synClassToDoor(orgId, classId);
            log.info("进入同步班级信息到门禁.....end");
        } catch (Exception e) {
            log.error("同步班级信息到门禁异常，{}", e);
            e.printStackTrace();
        }
    }
}
